<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" id="updateTarget">
    <head>
    	<title></title>
    	<script type="text/javascript">
    		//Create an XSLT processor instance
    		var processor = new XSLTProcessor();
    		
    		//Create an empty XML document for the XSLT transform
    		var transform = document.implementation.createDocument( "", "", null );
    		
    		//Load the XSLT
    		transform.onload = loadTransform;
    		transform.load( "stylesheets/message.xsl" );
    		
    		//Triggered once the XSLT document is loaded
    		function loadTransform() {
			//Attach the transform to the processor
			processor.importStylesheet( transform );
			source = document.implementation.createDocument( "", "", null );
			source.load( "schemas/PurchaseOrder.xsd" );
			source.onload = runTransform;
    		}
    			
    		//Triggered once the source document is loaded
    		function runTransform() {
			//Run the transform, creating a fragment output subtree that
			//can be inserted back into the main page document object (given
			//in the second argument)
			var newDocument = processor.transformToDocument( source );
			var xmlSerializer = new XMLSerializer();
			var markup = xmlSerializer.serializeToString( newDocument );
			document.write(markup);
			document.close();
    		}
    	</script>
    </head>
    <body>
    </body>
</html>